echo off
echo ##### Copying BookML for distribution ####

set dir=bookml-0.1-dist

rmdir ..\%dir% /s /q
del ..\%dir%.zip

md ..\%dir%
md ..\%dir%\config
md ..\%dir%\document
md ..\%dir%\external
md ..\%dir%\images
md ..\%dir%\pdf
md ..\%dir%\sample
md ..\%dir%\schema
md ..\%dir%\stylesheet
md ..\%dir%\fo
md ..\%dir%\test
md ..\%dir%\util
md ..\%dir%\win32util

copy Makefile.win ..\%dir%
copy Makefile.mac ..\%dir%
xcopy config ..\%dir%\config /s /d /y /exclude:dist-exclude.txt
xcopy document ..\%dir%\document /s /d /y /exclude:dist-exclude.txt
xcopy external ..\%dir%\external /s /d /y /exclude:dist-exclude.txt
xcopy images ..\%dir%\images /s /d /y /exclude:dist-exclude.txt
xcopy pdf ..\%dir%\pdf /s /d /y 
xcopy sample ..\%dir%\sample /s /d /y /exclude:dist-exclude.txt
xcopy schema ..\%dir%\schema /s /d /y /exclude:dist-exclude.txt
xcopy stylesheet ..\%dir%\stylesheet /s /d /y /exclude:dist-exclude.txt
xcopy test ..\%dir%\test /s /d /y /exclude:dist-exclude.txt
xcopy util ..\%dir%\util /s /d /y /exclude:dist-exclude.txt
xcopy win32util ..\%dir%\win32util /s /d /y /exclude:dist-exclude.txt

zip ..\%dir%.zip -q -r ..\%dir%

echo ##### Finished. Check '%dir%' folder and '%dir%.zip' ####


